package com.atom.common.delegate;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

/**
 * Title: TaskCompleteDelegateHandler
 * Description: 任务完成时将代理日志相关记录标记为已完成
 * @author WEWE
 * @date 2017年12月5日 上午11:32:56
 * @version 1.0
 */
@Component
@Transactional
public class TaskCompleteDelegateHandler {
  
  @Resource DelegateLogDao delegateLogDao;

  public void execute(String taskId) {
    List<DelegateLog> list = delegateLogDao.findByTaskId(taskId);
    for (DelegateLog log : list) {
      log.setIsComplete(1);
      delegateLogDao.update(log);
    }
    
  }

}
